#@ucenter_layout()

#define css()
<style>
    .form-header{
        margin: 10px 0 20px;
    }
    .invoice-info{
        padding:1rem;
    }
    table td,table th{
        font-size: 14px;
    }
</style>
#end

#define content()
<!--<div class="content-wrapper" style="min-height: 1126px;">-->
<section class="content">

    <div class="container-fluid">
        <div class="card card-outline card-primary">

    <!-- Main content -->
    <section>
        <!-- title row -->

        <h2 class="form-header">
            <i class="fa fa-globe"></i> 余额信息.
<!--                    <small class="float-right">Date: 2/10/2014</small>-->
        </h2>

        <!-- info row -->
        <div class="row invoice-info">
            <div class="col-4 invoice-col">
                <div>
                    <strong>可用余额</strong>
                    <div style="font-size: 2rem;">
                        #number(userAmount,'0.00')
                    </div>
                </div>
                <div style="padding-top: 20px">

                    #if(option('payout_enable'))
                    <a  href="#(CPATH)/ucenter/finance/amount/payout" class="btn btn-primary "><i class="fa fa-paper-plane"></i>
                        提现
                    </a>
                    #end

                    <a  href="#(CPATH)/ucenter/finance/amount/recharge" class="btn btn-primary "><i class="fa fa-credit-card"></i>
                        充值
                    </a>

                </div>
            </div>
            <!-- /.col -->
            <div class="col-6 offset-sm-2">
                <p class="lead">本月统计</p>

                <div class="table-responsive">
                    <table class="table">
                        <tbody><tr>
                            <th style="width:50%">收入：</th>
                            <td>+#number(incomeAmount ?? 0 ,'0.00')</td>
                        </tr>
                        <tr>
                            <th>支出：</th>
                            <td>#number(payAmount ?? 0 ,'0.00')</td>
                        </tr>
                        <tr>
                            <th>提现：</th>
                            <td>#number(payoutAmount ?? 0 ,'0.00')</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <!-- /.col -->
        </div>
    </section>

    <!-- Main content -->
    <section>
        <!-- title row -->

        <h2 class="form-header">
            <i class="fa fa-globe"></i> 账户流水.
        </h2>



        <!-- Table row -->
            <div class="col-12 table-responsive p-0">
                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th>收入/支出</th>
                        <th>项目</th>
                        <th>相关</th>
                        <th>金额</th>
                        <th>时间</th>
                    </tr>
                    </thead>
                    <tbody>
                    #for(statement : userAmountStatements)
                    <tr #(statement.change_amount > 0 ? 'style="background-color: #e8ffe6"' : 'style="background-color: #ffe6e6"') >
                        <td>#(statement.change_amount > 0 ? '收入' : '支出')</td>
                        <td>#(statement.action_name ??)</td>
                        <td>#(statement.action_desc ??)</td>
                        <td>#(statement.change_amount > 0 ? '+' : '-')#(statement.change_amount ??)</td>
                        <td>#date(statement.created)</td>
                    </tr>
                    #else
                    <tr class="nodata"><td colspan="999">暂无数据</td> </tr>
                    #end
                    </tbody>
                </table>
            </div>
            <!-- /.col -->
        <!-- /.row -->
    </section>

    <div class="clearfix"></div>


        </div>
    </div>
</section>
<!--</div>-->
#end
